package com.project.communitymanagement.controller;

import com.project.communitymanagement.common.BaseController;
import com.project.communitymanagement.common.Page;
import com.project.communitymanagement.common.ResponseEntity;
import com.project.communitymanagement.entity.TbApprovaDts;
import com.project.communitymanagement.service.TbApprovaDtsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("tbapprovadts")
public class TbApprovaDtsController extends BaseController<TbApprovaDtsService, TbApprovaDts> {

    @Autowired
    private TbApprovaDtsService tbapprovadtsService;

    @Override
    protected TbApprovaDtsService service() {
        return tbapprovadtsService;
    }

    @PostMapping("getDataByLeaveId")
    public ResponseEntity<Page> getDataByLeaveId(@RequestBody TbApprovaDts data){
        return ResponseEntity.success(tbapprovadtsService.getDataByLeaveId(data.getLeave_id()));
    }
}

